DigiLocker Verify XML File API
The following document highlights the details of the DigiLocker Verify XML File API.
API Description
Objective
The DigiLocker Verify XML File API checks whether the provided input is a valid XML file and extracts values from an Aadhaar XML file.
| Input | Output |
|---|---|
| An XML file (Aadhaar XML) | Extracted values from the Aadhaar XML file including name, date of birth, gender, address details, masked Aadhaar number, photo, and validation status |
API URL
https://ind-verify.hyperverge.co/api/digilocker/verifyXml
API Endpoint
verifyXml
Overview
The DigiLocker Verify XML File API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.
Method - POST
Authentication
You need a unique pair of application ID ( appId ) and application key ( appKey ) from HyperVerge to verify your identity for accessing the API.
Headers
| Header | Mandatory / Optional | Description | Input Format |
|---|---|---|---|
| content-type | Mandatory | This parameter defines the media type for the request payload | multipart/form-data |
| appId | Mandatory | The application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab | This should be a unique value |
| appKey | Mandatory | The application key shared by HyperVerge. You can find the details in the dashboard's credentials tab | This should be a unique value |
| transactionId | Optional | A unique identifier for tracking a user journey | This should be both unique and easily associated with the user's journey in your application(s) |
Inputs
The following table provides the details of the parameters required for the DigiLocker Verify XML File API's request body:
| Parameter | Mandatory / Optional | Type | Description | Input Format | Default Value |
|---|---|---|---|---|---|
xmlFile | Mandatory | file | XML File as file type | Not Applicable | Not Applicable |
Request
The following code snippet demonstrates a standard curl request for the DigiLocker Verify XML File API:
curl --location --request POST 'https://ind-verify.hyperverge.co/api/digilocker/verifyXml' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'xmlFile=@"<path_to_xml_file>"'
Success Responses
The following code snippets demonstrate success responses from the DigiLocker Verify XML File API:
- Success Response
{
"status": "success",
"statusCode": "200",
"result": {
"name": "<Name_of_the_User>",
"dob": "<Date_Of_Birth_in_DD-MM-YYYY_Format>",
"gender": "<Gender>",
"rawAddress": "<Complete_Raw_Address>",
"maskedAadhaarNumber": "<Masked_Aadhaar_Number>",
"photo": "<Base64_Image_Of_The_Users_Profile_Photo>",
"address": {
"co": "<Care_Of_Field>",
"country": "<Country>",
"district": "<District>",
"house": "<House_Number>",
"locality": "<Locality>",
"pincode": "<Pincode>",
"state": "<State>",
"street": "<Street>",
"vtc": "<Village_Town_City>",
"landmark": "<Landmark>"
},
"isValidXML": "<Boolean_Value_Indicating_If_XML_Is_Valid>"
}
}
Success Response Details
The following table outlines the details of the success response from the DigiLocker Verify XML File API:
| Parameter | Type | Description |
|---|---|---|
status | string | The status of the request |
statusCode | string | The HTTP status code for the response |
result | object | The JSON object containing the extracted XML data |
result.name | string | The name of the user |
result.dob | string | The date of birth of the user in DD-MM-YYYY format |
result.gender | string | The gender of the user |
result.rawAddress | string | The complete unstructured address of the user |
result.maskedAadhaarNumber | string | The masked Aadhaar number of the user |
result.photo | string | The base64-encoded profile photo of the user |
result.address | object | The structured address object containing address components |
result.address.co | string | The name of the individual listed in the care-of field, indicating the user's parent or guardian (e.g., son of/daughter of) |
result.address.country | string | The country in the user's address |
result.address.district | string | The district in the user's address |
result.address.house | string | The house number in the user's address |
result.address.locality | string | The locality in the user's address |
result.address.pincode | string | The postal code in the user's address |
result.address.state | string | The state in the user's address |
result.address.street | string | The street in the user's address |
result.address.vtc | string | The village, town, or city in the user's address |
result.address.landmark | string | The landmark in the user's address |
result.isValidXML | boolean | Indicates if the XML document is valid |
Error Responses
The following are some error responses from the DigiLocker Verify XML File API:
- Invalid Aadhaar File
- Missing or Invalid Credentials
{
"status": "failure",
"statusCode": "400",
"error": {
"code": "ER_INVALID_AADHAAR_XML",
"message": "Invalid Aadhaar XML"
}
}
{
"status": "failure",
"statusCode": "401",
"error": "Missing/Invalid credentials"
}
Error Response Details
A failure or error response contains a failure status with a relevant status code and error message.
The following table lists all error responses:
| Status Code | Error Message | Error Description | Error Resolution |
|---|---|---|---|
| 400 | Invalid Aadhaar XML | The Aadhaar XML file provided is invalid | Please upload a valid Aadhaar XML file |
| 401 | Missing/Invalid credentials | The request is either missing the mandatory appId and appKey combination or has invalid values | Provide valid appId and appKey credentials in the request |